/**
 * @summary 基础试题模块
 * @module questions
 * @author hmmmm
 */

 import * as questionsApi from '@/api/hmmm/questions.js'

 const state = {
   basicquestions: {},
   detail: {},
   choiceness: {},
 }
 console.log(state);
 const mutations = {
   // 基础题库列表
   UPDATE_BASICQUESTIONS_LIST(state, newValue) {
     state.basicquestions = newValue
   },
   // 基础题库详情
   UPDATE_DETAIL(state, newValue) {
     state.detail = newValue
   },
   UPDATE_CHOICE_LIST(state, newValue) {
     state.choiceness = newValue
   }
 }

 const actions = {
   // 基础题库列表
   async uptateBasicquestionsList({ commit }, data) {
     const res = await questionsApi.questionslist(data)
     commit('UPDATE_BASICQUESTIONS_LIST', res)
   },
   // 基础题库详情
   async uptateDetail({ commit }, data) {
     const res = await questionsApi.detailquestion(data)
     commit('UPDATE_DETAIL', res)
   },
   async uptatechoiceList({ commit }, data) {
     const res = await questionsApi.choiceList(data)
     commit('UPDATE_CHOICE_LIST', res)
   }
 }

 export default {
   namespaced: true,
   state,
   mutations,
   actions,
 }
